import request from '@/request/axios';
// 获取验证码
export const getCodeImg = () => {
    return request({
        url: '/go-admin/api/v1/captcha',
        method: 'get',
    });
};
// login 登陆
interface LoginType {
    username: string;
    password: string;
    code: string;
}
export function login(data: LoginType) {
    return request({
        url: '/go-admin/api/v1/login',
        method: 'post',
        data,
    });
}

// logout 退出
export function logout() {
    return request({
        url: '/go-admin/api/v1/logout',
        method: 'post',
    });
}

// refreshtoken 刷新token
export function refreshtoken(data: any) {
    return request({
        url: '/go-admin/refreshtoken',
        method: 'post',
        data,
    });
}

// getInfo 获取用户基本信息
export function getInfo() {
    return request({
        url: '/go-admin/api/v1/getinfo',
        method: 'get',
    });
}
